<template>
  <div id="app">
    
    <!-- <div id="nav">
      <img id="logo" src="http://pcera22ot.bkt.clouddn.com/logo_icon_black.png">
      <router-link to="/">首页</router-link>
      <router-link to="/project">项目</router-link>
      <router-link to="/graphicdesign">设计</router-link>
    </div>
    <router-link to="/mininav">
    <div id="nav-mini" v-if="$route.path != '/mininav'">
      <img id="logo" src="http://pcera22ot.bkt.clouddn.com/logo_icon_black_menu.png">
    </div>
    </router-link> -->
    <!-- <transition name="fade">
      <div v-if="$route.path == '/mininav'" id="nav-mini" @click="$router.go(-1)">
        <img id="logo" src="http://pcera22ot.bkt.clouddn.com/logo_icon_black_menu_close.png">
      </div>
    </transition> -->
    
    <!-- <div id="fake-nav"></div> -->
    <transition name="fade">
      <router-view/>
    </transition>
    <!-- <footer v-if="$route.path != '/mininav'">
      <a>HAITAOBOT.COM</a>
    </footer> -->
  </div>
</template>

<script>
export default {
  watch: {
  '$route' (to, from) {
    const toDepth = to.path.split('/').length
    const fromDepth = from.path.split('/').length
    this.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
  }
}
}

</script>

<style>
#app {
  font-family: "SF Pro SC", "SF Pro Text", "Myriad Set Pro", "SF Pro Icons",
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", "Helvetica", "Arial",
    sans-serif;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #000000;
}

#logo {
  width: 40px;
  margin-bottom: 20px;
}

#nav-mini {
  display: none;
}

#nav {
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: fixed;
}

#nav a {
  font-size: 10px;
  font-weight: 400;
  margin: 2px;
  padding-bottom: 2px;
  color: #000000;
  text-decoration: none;
}

footer a {
  font-size: 10px;
  font-weight: 400;
  margin: 2px;
  padding-bottom: 2px;
  color: #000000;
  text-decoration: none;
}

#nav a.router-link-exact-active {
  color: #000000;
  font-weight: 600;
}
#fake-nav {
  display: none;
}
h1 {
  font-weight: 200;
  font-size: 50px;
}
footer {
  margin-top: 100px;
  padding-top: 10px;
  padding-bottom: 30px;
  border-top: 1px solid #eeeeee;
  font-size: 8px;
  font-weight: bold;
  color: grey;
}
.fade-enter-active {
  transition: opacity .5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
@media only screen and (max-width: 767px) {
  #nav {
    display: none;
  }
  #nav-mini {
    display: block;
    width: 100%;
    padding: 0;
    display: flex;
    top: 0px;
    left: 0px;
    flex-direction: row;
    align-items: flex-start;
    position: fixed;
    background: #ffffff;
    z-index: 20;
  }
  #logo {
    width: 40px;
    margin-bottom: 20px;
    margin: 15px 0px 15px 30px;
  }
  #fake-nav {
    display: block;
    height: 40px;
  }
}
</style>
